package demo;

interface A {
    void test1();
    static void test2() {
        System.out.println("static()");
    }
    default void test3() {
        System.out.println("default()");
    }
}
class TestDemo implements A {
    @Override
    public void test1() {
        //必须重写
        System.out.println("重写方法test1()!");
    }
    @Override
    public void test3() {
        //不重写也可以
        System.out.println("重写test3()");
    }
}
public class Test {
    public static void main(String[] args) {
        TestDemo testDemo = new TestDemo();
        testDemo.test1();
        testDemo.test3();
        A.test2();
    }
}
